package edu.java.lectures.lec05.polimorphism;

public class IsoscelesTriangle extends EquilateralTriangle {

    // --- Static Block ------------------------------------------------------
    static {
	System.out.println("static block - IsoscelesTriangle");
    }

    // --- Dynamic Block ------------------------------------------------------
    {
	System.out.println("dynamic block - IsoscelesTriangle");
    }

    // --- Instance Variable ---------------------------------------------------

    // // bedro
   static double statA=2;
   static double statB=7;
   double a;

    // osnowa
    double b;

    // --- Constructors --------------------------------------------------------
    public IsoscelesTriangle() {
//	super();
	System.out.println("Constructor IsoscelesTriangle");
    }

    public IsoscelesTriangle(double a, double b) {
	// super();
	this();
	this.a = a;
	this.b = b;
	
	System.out.println("\n\n");
	System.out.println("super.a: " + super.a);
	System.out.println("this.a: " + this.a);
	
    }

    // --- Getters and Setters -------------------------------------------------

     public double getA() {
     return a;
     }
    
     public void setA(double a) {
     this.a = a;
     }

    public double getB() {
	return b;
    }

    public void setB(double b) {
	this.b = b;
    }

    // --- Method --------------------------------------------------------------

    // overriding - predifining behaviour which is DECLARED in parent class
    @Override
    public double calculatePerimeter() {
	return 2 * a + b;
    }

    @Override
    public double calculateSurface() {
	double semiP = calculatePerimeter() / 2;
	double divident = semiP * (Math.pow((semiP - a), 2)) * (semiP - b);
	double result = Math.sqrt(divident);
	return result;
    }

    @Override
    public String toString() {
	System.out.println("catch me");
	return "(" + this.a + "," + this.b + ")";
    }

    @Override
    public String getMedicenterName() {
	 return "I";
//	return super.getMedicenterName();
    }

    // public String wrapperMedicenterName() {
    // retgetMedicenterName
    // }
    
    public void specialMethod(){
	System.out.println("Proba, proba");
    }
}
